home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Dreamweaver 3 / Configuration / Commands / InsertEnt.js < prev    next >
Encoding:
Text File  |  1999-12-01  |  1.4 KB  |  56 lines

  1. // Copyright 1999 Macromedia, Inc. All rights reserved.
  2.  
  3. //---------------   GLOBAL VARIABLES   ---------------
  4.  
  5. var helpDoc = MM.HELP_objInsertEntity;
  6.  
  7. //---------------     API FUNCTIONS    ---------------
  8.  
  9. function commandButtons(){
  10.   return new Array(BTN_OK,    'insertChars()',
  11.                    BTN_Cancel,'cleanupUI()',
  12.                    BTN_Help,  'displayHelp()');
  13. }
  14.  
  15. function canAcceptCommand() {
  16.   return true;
  17. }
  18.  
  19.  
  20. //---------------    LOCAL FUNCTIONS   ---------------
  21.  
  22. // function: initUI
  23. // description: initialize UI and other associated preferences
  24. function initUI() {  
  25. }
  26.  
  27. // function: cleanupUI
  28. // description: 
  29. function cleanupUI() {
  30.   // Exit
  31.   document.entityForm.Insert.childNodes[1].value = '';
  32.   window.close();
  33. }
  34.  
  35. // function: insertChars
  36. // description: Insert selected character and cleanupUI
  37. function insertChars(curChar) {
  38. // As an Object this command uses the return value in Object tag to insert characters.
  39.   window.close();
  40. }
  41.  
  42. // function: objectTag
  43. // description: Return inserted value for an Object
  44. function objectTag() {
  45.   // Return the html tag that should be inserted
  46.   return document.entityForm.Insert.childNodes[1].value;
  47. }
  48.  
  49. //--- Interface Support Functions
  50.  
  51. // Handles selection and display of choosen character in the form field.
  52. function setChar(curChar) {
  53.   // Add the character to the insertion field.
  54.   document.entityForm.Insert.childNodes[1].value = '&' + curChar + ';';
  55. }
  56.